<?php
/**
 * @purpose
 * @Author: Madou
 * @Time  : 2022/8/3 18:18
 */

namespace App\Trip\Payment;

class ParsePaymentAttach
{
    private string $attach;

    public function __construct(string $attach)
    {
        $this->parse($attach);
    }

    private function parse(string $attach): void
    {
        $this->attach = json_decode($attach, true);
    }

    public function getType(): int
    {
        return $this->attach['type'];
    }

    public function getOrderSn(): string
    {
        return $this->attach['order_sn'] ?? '';
    }

    public function getTaskId(): string
    {
        return $this->attach['task_id'] ?? '';
    }
}